package com.scar1et.decorator;

import com.scar1et.decorator.person.image.*;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * 客户端
 * Created by scar1et on 15-10-26.
 */
public class Main {
    public static void main(String[] args) {
        String yesOrNo = "y";
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while ("y".equalsIgnoreCase(yesOrNo)) {
            String name = "";
            try {
                System.out.println("请输入您的名字： ");
                name = br.readLine().trim();

                System.out.println("\n---------------------------------");
                System.out.println("第一套装扮： ");
                new Suit(new LeatherShoes(new Tie(new Person(name)))).show();

                System.out.println("\n---------------------------------");
                System.out.println("第二套装扮： ");
                new TShirt(new BrokenShoes(new BigTrouser(new Person(name)))).show();

                System.out.println("还有下一人？（y/n）");
                yesOrNo = br.readLine().trim();
            } catch (Exception e) {
                e.printStackTrace();
                System.out.println(e.getMessage() + "");
            }
        }
    }
}
